Skip to content

Conversation

caseyclements
Copy link
Contributor

This is an alternative approach to #2162.

@blink1073
Copy link
Member

ImportError while loading conftest '/home/runner/work/mongo-python-driver/mongo-python-driver/test/conftest.py'.
test/__init__.py:35: in <module>
    from pymongo.uri_parser import parse_uri
pymongo/__init__.py:91: in <module>
    from pymongo.asynchronous.mongo_client import AsyncMongoClient
pymongo/asynchronous/mongo_client.py:61: in <module>
    from bson.codec_options import DEFAULT_CODEC_OPTIONS, CodecOptions, TypeRegistry
bson/__init__.py:105: in <module>
    from bson.binary import (
bson/binary.py:231: in <module>
    class BinaryVector:
E   ValueError: 'padding' in __slots__ conflicts with class variable

@caseyclements
Copy link
Contributor Author

caseyclements commented Mar 3, 2025

ImportError while loading conftest '/home/runner/work/mongo-python-driver/mongo-python-driver/test/conftest.py'.
test/__init__.py:35: in <module>
    from pymongo.uri_parser import parse_uri
pymongo/__init__.py:91: in <module>
    from pymongo.asynchronous.mongo_client import AsyncMongoClient
pymongo/asynchronous/mongo_client.py:61: in <module>
    from bson.codec_options import DEFAULT_CODEC_OPTIONS, CodecOptions, TypeRegistry
bson/__init__.py:105: in <module>
    from bson.binary import (
bson/binary.py:231: in <module>
    class BinaryVector:
E   ValueError: 'padding' in __slots__ conflicts with class variable

Yeah. This is why I opened this new one up. Thought maybe you or @ShaneHarvey could see the issue. In #2162, I've removed the dataclass decorator. I've already implemented init, repr, and don't want ==, >=.... What do you guys think?

@blink1073
Copy link
Member

Ah, that explains why we added __init__ in the first place. I think we have no choice since the slots feature isn't available until Python 3.10.

@ShaneHarvey
Copy link
Member

I see, then let's close this PR and continue with the other one.

@ShaneHarvey ShaneHarvey closed this Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants